﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 第三次作业
{
    class Rectangle:Shape
    {
        public double longedge { set; get; }
        public double shortedge { set; get; }
        public double area;
        public Rectangle(double longedge, double shortedge)
        {
            this.longedge = longedge;
            this.shortedge = shortedge;
            calculate();
        }
        public override void calculate()
        {
            area = longedge * shortedge;
        }
        public override double getArea()
        {
            return area;
        }
        override public bool isTrue() 
        {
            if (longedge > 0 && shortedge > 0) return true;
            else
                return false;
        }
    }
}
